package com.coderman.basketball.statistics.service;

import com.coderman.basketball.statistics.dto.GameEventDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Description:
 * date: 2021/5/13
 *
 * @author shenshuai
 * @version 1.0.0
 * @since JDK 1.8
 * 比赛活动处理服务
 */
@Service
public class GameEventService {
    @Autowired
    private GameEventHandlerContainer gameEventHandlerContainer;

    /**
     * 处理事件
     * @param gameEventDTO
     */
    public void dealEvent(GameEventDTO gameEventDTO){
        EventHandler eventHandler = gameEventHandlerContainer.getEventHandler(gameEventDTO.getEventCode());
        eventHandler.execute(gameEventDTO);
    }
}
